package model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.codehaus.jackson.annotate.JsonIgnore;

@Entity
@Table(name = "HORAIRE_TRAIN")
public class HoraireTrain{
	private int id;
	private String heureDepart;
	private String heureArrivee;
	private String Correspondence;
	private VoyageTrain voyageTrain;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "HORAIRE_TRAIN_ID")
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@Column(name = "HEUREDEPART")
	public String getHeureDepart() {
		return heureDepart;
	}

	public void setHeureDepart(String heureDepart) {
		this.heureDepart = heureDepart;
	}

	@Column(name = "HEUREARRIVEE")
	public String getHeureArrivee() {
		return heureArrivee;
	}

	public void setHeureArrivee(String heureArrivee) {
		this.heureArrivee = heureArrivee;
	}

	@Column(name = "CORRESPONDENCE")
	public String getCorrespondence() {
		return Correspondence;
	}

	public void setCorrespondence(String correspondence) {
		Correspondence = correspondence;
	}

	public HoraireTrain() {
	}

	public HoraireTrain(String heureDepart, String heureArrivee,
			String correspondence, VoyageTrain voyageTrain) {
		this.heureDepart = heureDepart;
		this.heureArrivee = heureArrivee;
		this.Correspondence = correspondence;
		this.voyageTrain = voyageTrain;
	}

	@ManyToOne
	@JoinColumn(name = "VOYAGE_TRAIN_ID")
	@JsonIgnore
	public VoyageTrain getVoyageTrain() {
		return voyageTrain;
	}

	public void setVoyageTrain(VoyageTrain voyageTrain) {
		this.voyageTrain = voyageTrain;
	}

	@Override
	public String toString() {
		return "HoraireTrain [heureDepart=" + heureDepart + ", heureArrivee="
				+ heureArrivee + ", Correspondence=" + Correspondence + "]";
	}

}
